package com.abvnet.project.water.api.web;

import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.domain.AjaxResult;
import com.abvnet.project.water.project.domain.ProjectMicrobial;
import com.abvnet.project.water.project.service.IProjectMicrobialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/microbial")
public class ApiProjectMicrobialController extends BaseController {

    @Autowired
    private IProjectMicrobialService projectMicrobialService;

    @GetMapping("/list")
    public AjaxResult list() {
        startPage();
        List<ProjectMicrobial> list = projectMicrobialService.selectListForApi();
        return pageSuccess(list);
    }

    @GetMapping("/datas")
    public AjaxResult datas() {
        AjaxResult ar = AjaxResult.success();
        ar.put("microList", projectMicrobialService.selectMicroList());
        ar.put("csList", projectMicrobialService.selectCsList());
        ar.put("phosList", projectMicrobialService.selectPhosList());
        ar.put("flocList", projectMicrobialService.selectFlocList());
        ar.put("oxidList", projectMicrobialService.selectOxidList());
        ar.put("otherList", projectMicrobialService.selectOtherList());
        return ar;
    }
}
